#!/bin/sh

# schedule_reboot: Determines whether the Radmind update requires a reboot.
#                  The current metric is that anything outside of /Applications
#                  requires a reboot. This could be improved; in general you
#                  want to provide cases where a reboot is NOT required and only
#                  reboot in cases where there's something left.

# Suck in defaults.
. /etc/radmind.defaults

transcript="${1}"
result="${transcript}.$$"

/usr/bin/grep -v "./Applications/" "${transcript}" > "${result}"

if test -n "${result}"; then #result is non-empty
	# Schedule a reboot
	touch "${REBOOT_FLAG}"
fi

rm -f "${result}"
